#pragma once

#include <QWidget>
#include <QSharedPointer>
#include "utils.h"

class OcctWidgetPrivate;
class OcctWidget : public QWidget
{
    Q_OBJECT
public:
    OcctWidget(QWidget *parent = nullptr);
    ~OcctWidget();
    void initOcctWidget();

    void readSTEP(const QString &fileName);
    void processSTEP();
    void readPly(int index, QString path);
    void readPlys(int index, QString path);
    void registPly(bool isCoarse);
    void removePlys(int index);
    void unselectFace(int faceID);
    void setSTEPSlide(int value);

protected:
    virtual QPaintEngine* paintEngine() const override;
    virtual void paintEvent(QPaintEvent *event) override;
    virtual void resizeEvent(QResizeEvent *event) override;
    virtual void mousePressEvent(QMouseEvent *event) override;
    virtual void mouseReleaseEvent(QMouseEvent *event) override;
    virtual void mouseMoveEvent(QMouseEvent *event) override;
    virtual void wheelEvent(QWheelEvent *event) override;

private:
    QSharedPointer<OcctWidgetPrivate> d;
    QVector<int> m_selectFace;
    Utils::GraphicsEntity m_entity;

signals:
    void faceSelected(int faceID, bool select);
};


